Skip to content

fix(FR-2583): update cached access key in client config after switching main keypair#6621

Merged
graphite-app[bot] merged 1 commit intomainfrom
fix/stale-main-access-key-after-switch
Apr 23, 2026
Merged

fix(FR-2583): update cached access key in client config after switching main keypair#6621
graphite-app[bot] merged 1 commit intomainfrom
fix/stale-main-access-key-after-switch

Conversation

@agatha197
Copy link
Copy Markdown
Contributor

@agatha197 agatha197 commented Apr 13, 2026

Resolves #6620 (FR-2583)

Summary

  • After switching main access key, show a modal informing the user that re-login is required
  • On confirm, trigger logout via backend-ai-logout event to ensure all cached credentials are refreshed
  • Add i18n translations for ReLoginRequired and MainKeyChangedNeedRelogin keys (21 languages)

Test plan

  • Switch main access key via keypair management modal
  • Verify info modal appears with re-login message
  • Confirm modal cannot be dismissed without clicking the confirm button
  • Click confirm and verify logout + redirect to login page
image

Copy link
Copy Markdown
Contributor Author


How to use the Graphite Merge Queue

Add either label to this PR to merge it via the merge queue:

  • flow:merge-queue - adds this PR to the back of the merge queue
  • flow:hotfix - for urgent changes, fast-track this PR to the front of the merge queue

You must have a Graphite account in order to use the merge queue. Sign up using this link.

An organization admin has required the Graphite Merge Queue in this repository.

Please do not merge from GitHub as this will restart CI on PRs being processed by the merge queue.

This stack of pull requests is managed by Graphite. Learn more about stacking.

@agatha197 agatha197 marked this pull request as ready for review April 13, 2026 03:56
Copilot AI review requested due to automatic review settings April 13, 2026 03:56
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Updates the WebUI keypair management flow to immediately refresh the cached Backend.AI client access key after a successful “switch main keypair” mutation, avoiding stale key usage across components/hooks that read baiClient._config.accessKey.

Changes:

  • Mutates globalThis.backendaiclient._config.accessKey on switchMyMainAccessKey completion.
  • Keeps existing refetch + success notification behavior after switching the main key.

Comment thread react/src/components/MyKeypairManagementModal.tsx Outdated
Comment thread react/src/components/MyKeypairManagementModal.tsx
@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Apr 13, 2026

Coverage report for ./react

St.
Category Percentage Covered / Total
🔴 Statements 8.59% 1757/20454
🔴 Branches 7.87% 1131/14373
🔴 Functions 5.14% 285/5547
🔴 Lines 8.31% 1649/19844

Test suite run success

856 tests passing in 39 suites.

Report generated by 🧪jest coverage report action from 2b2fe60

@agatha197 agatha197 force-pushed the fix/stale-main-access-key-after-switch branch from c97ae0f to ade188d Compare April 13, 2026 05:16
@github-actions github-actions Bot added area:ux UI / UX issue. area:i18n Localization labels Apr 13, 2026
@agatha197 agatha197 force-pushed the fix/stale-main-access-key-after-switch branch from ade188d to 71ad453 Compare April 13, 2026 05:25
@github-actions github-actions Bot added size:M 30~100 LoC and removed size:XS ~10 LoC labels Apr 13, 2026
@agatha197 agatha197 requested a review from Copilot April 13, 2026 05:28
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 22 out of 22 changed files in this pull request and generated no new comments.

Copy link
Copy Markdown
Contributor

@nowgnuesLee nowgnuesLee left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please create a jira issue and link the jira issue.

@agatha197 agatha197 changed the title fix: update cached access key in client config after switching main keypair fix(FR-2583): update cached access key in client config after switching main keypair Apr 15, 2026
@agatha197
Copy link
Copy Markdown
Contributor Author

agatha197 commented Apr 15, 2026

Created Jira issue FR-2583 and linked it in the PR description.

@agatha197 agatha197 requested a review from nowgnuesLee April 15, 2026 08:04
@agatha197 agatha197 force-pushed the fix/stale-main-access-key-after-switch branch from 71ad453 to 908ce95 Compare April 15, 2026 15:03
Copy link
Copy Markdown
Contributor

@nowgnuesLee nowgnuesLee left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@graphite-app
Copy link
Copy Markdown

graphite-app Bot commented Apr 23, 2026

Merge activity

…ng main keypair (#6621)

Resolves #6620 (FR-2583)

## Summary
- After switching main access key, show a modal informing the user that re-login is required
- On confirm, trigger logout via `backend-ai-logout` event to ensure all cached credentials are refreshed
- Add i18n translations for `ReLoginRequired` and `MainKeyChangedNeedRelogin` keys (21 languages)

## Test plan
- [ ] Switch main access key via keypair management modal
- [ ] Verify info modal appears with re-login message
- [ ] Confirm modal cannot be dismissed without clicking the confirm button
- [ ] Click confirm and verify logout + redirect to login page
<img width="439" height="179" alt="image" src="https://github.com/user-attachments/assets/054b6428-ffd6-4929-9c28-4ac82d806738" />
@graphite-app graphite-app Bot force-pushed the fix/stale-main-access-key-after-switch branch from 908ce95 to 2b2fe60 Compare April 23, 2026 10:25
@graphite-app graphite-app Bot merged commit 2b2fe60 into main Apr 23, 2026
10 checks passed
@graphite-app graphite-app Bot deleted the fix/stale-main-access-key-after-switch branch April 23, 2026 10:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area:i18n Localization area:ux UI / UX issue. size:M 30~100 LoC

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Stale main access key in client config after switching main keypair

3 participants